package com.itfreer.arcgis;

import android.location.Location;

public class GPSUtils
{
    /**
     * 获取两点间距离
     * @param lat1
     * @param lon1
     * @param lat2
     * @param lon2
     * @return
     */
    public static double GetDistance(double lat1, double lon1, double lat2, double lon2)
    {
        float[] results=new float[1];
        try
        {
            Location.distanceBetween(lat1, lon1, lat2, lon2, results);
        }
        catch(Exception e)
        {
            e.printStackTrace();
        }
        return results[0];
    }
}
